public class CalculatorTest {
    public static void main(String[] args) {
        Calculator calculator = new Calculator();

        // 测试加法
        int result1 = calculator.add(5, 3);
        System.out.println("5 + 3 = " + result1);

        // 测试减法
        int result2 = calculator.subtract(10, 4);
        System.out.println("10 - 4 = " + result2);

        // 测试乘法
        int result3 = calculator.multiply(6, 7);
        System.out.println("6 * 7 = " + result3);

        // 测试除法
        try {
            double result4 = calculator.divide(8, 0);
            System.out.println("8 / 0 = " + result4);
        } catch (IllegalArgumentException e) {
            System.out.println("错误: " + e.getMessage());
        }

        double result5 = calculator.divide(8, 2);
        System.out.println("8 / 2 = " + result5);
    }
}

